<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue2.js"></script>
    <style>
        li{ overflow: hidden;
            list-style: none;
            padding: 10px;
        }
        img{
            float: left;
            width: 100px;
        }
    </style>
</head>
<body>
    <div id="box">
        <button @click="handleClick">请求数据</button>
        <ul>
            <li v-for="film in filmDataList">
                <img :src="film.poster">
                <span>{{film.name}}</span>
            </li>
        </ul>
    </div>
    <script>
        new Vue({
            el:'#box',
            data:{
            filmDataList:[]
            },
            methods:{
                handleClick(){
                    fetch("json/maizuo.json")
                    .then(res=>res.json())
                    .then(res=>{
                        this.filmDataList=res.data.films
                    })
                }
            },
            watch:{

            },
            computed:{

            }
        })
    </script>
</body>
</html>